<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="玖忆;文鹤;博客">
    
    <meta name="author" content="meteor">
    <!-- preconnect -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    
    
    <!--- Seo Part-->
    
    <link rel="canonical" href="https://wait-you.github.io/2023/06/06/领域驱动设计/"/>
    <meta name="robots" content="index,follow">
    <meta name="googlebot" content="index,follow">
    <meta name="revisit-after" content="1 days">
    
        <meta name="description" content="# 领域驱动设计 # 大型系统是如何 &quot;变老&quot; 的 # 面临的问题 当一个项目使用过长，他的运行效率低、代码乱，需要重构的时候，需要面临一些问题  沟通难  产品提出一个问题，开发却要很久   开发难  代码膨胀，对于大型软件，一个旧的类可能有上千行，无法确定更改后的影响有多大   测试难  改了个需求，测试需要组织庞大的测试计划   创新难  系统背负的业务越来越重，已经基本">
<meta property="og:type" content="article">
<meta property="og:title" content="领域驱动设计">
<meta property="og:url" content="https://wait-you.github.io/2023/06/06/%E9%A2%86%E5%9F%9F%E9%A9%B1%E5%8A%A8%E8%AE%BE%E8%AE%A1/index.html">
<meta property="og:site_name" content="玖忆">
<meta property="og:description" content="# 领域驱动设计 # 大型系统是如何 &quot;变老&quot; 的 # 面临的问题 当一个项目使用过长，他的运行效率低、代码乱，需要重构的时候，需要面临一些问题  沟通难  产品提出一个问题，开发却要很久   开发难  代码膨胀，对于大型软件，一个旧的类可能有上千行，无法确定更改后的影响有多大   测试难  改了个需求，测试需要组织庞大的测试计划   创新难  系统背负的业务越来越重，已经基本">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://tuchuang.wenhe9.cn/img/202211051602718.png">
<meta property="og:image" content="http://tuchuang.wenhe9.cn/img/202211051614128.png">
<meta property="og:image" content="http://tuchuang.wenhe9.cn/img/202211051626670.png">
<meta property="og:image" content="http://tuchuang.wenhe9.cn/img/202211052014483.png">
<meta property="og:image" content="http://tuchuang.wenhe9.cn/img/202211052021437.png">
<meta property="article:published_time" content="2023-06-06T01:10:51.000Z">
<meta property="article:modified_time" content="2023-06-05T09:11:20.462Z">
<meta property="article:author" content="meteor">
<meta property="article:tag" content="领域驱动设计">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://tuchuang.wenhe9.cn/img/202211051602718.png">
    
    
    <!--- Icon Part-->
    <link rel="icon" type="image/png" href="/images/wenhe.png" sizes="192x192">
    <link rel="apple-touch-icon" sizes="180x180" href="/images/wenhe.png">
    <meta name="theme-color" content="#f1404b">
    <link rel="shortcut icon" href="/images/wenhe.png">
    <!--- Page Info-->
    
    <title>
        
            领域驱动设计 -
        
        玖忆
    </title>
    
<link rel="stylesheet" href="/css/style.css">

    
<link rel="stylesheet" href="/assets/fonts.css">

    <!--- Font Part-->
    
    
    
    

    <!--- Inject Part-->
    
    <script id="hexo-configurations">
    let Global = window.Global || {};
    Global.hexo_config = {"hostname":"wait-you.github.io","root":"/","language":"zh-CN"};
    Global.theme_config = {"articles":{"style":{"font_size":"16px","line_height":1.5,"image_border_radius":"14px","image_alignment":"center","image_caption":false,"link_icon":true},"word_count":{"enable":true,"count":true,"min2read":true},"author_label":{"enable":true,"auto":false,"list":[]},"code_block":{"copy":true,"style":"mac","font":{"enable":false,"family":null,"url":null}},"toc":{"enable":true,"max_depth":3,"number":false,"expand":true,"init_open":true},"copyright":true,"lazyload":true,"recommendation":{"enable":false,"title":"推荐阅读","limit":3,"placeholder":"http://tuchuang.wenhe9.cn/default-bg.jpg","skip_dirs":[]}},"colors":{"primary":"#f1404b","secondary":null},"global":{"fonts":{"chinese":{"enable":false,"family":null,"url":null},"english":{"enable":false,"family":null,"url":null}},"content_max_width":"1000px","sidebar_width":"210px","hover":{"shadow":true,"scale":false},"scroll_progress":{"bar":true,"percentage":true},"busuanzi_counter":{"enable":true,"site_pv":true,"site_uv":true,"post_pv":true},"pjax":true,"open_graph":true,"google_analytics":{"enable":false,"id":null}},"home_banner":{"enable":true,"style":"static","image":{"light":"http://tuchuang.wenhe9.cn/default-bg.jpg","dark":"http://tuchuang.wenhe9.cn/default-bg.jpg"},"title":"玖忆","subtitle":{"text":["我本微末凡尘、可也心向天空"],"hitokoto":{"enable":false,"api":"https://v1.hitokoto.cn"},"typing_speed":100,"backing_speed":80,"starting_delay":500,"backing_delay":1500,"loop":true,"smart_backspace":true},"text_color":{"light":"#fff","dark":"#d1d1b6"},"text_style":{"title_size":"2.8rem","subtitle_size":"1.5rem","line_height":1.2},"custom_font":{"enable":false,"family":null,"url":null},"social_links":{"enable":true,"links":{"github":"https://gitee.com/du-jinliang","instagram":null,"zhihu":null,"twitter":null,"email":"dujinliang9@163.com"}}},"plugins":{"feed":{"enable":false},"aplayer":{"enable":false,"type":"fixed","audios":[{"name":null,"artist":null,"url":null,"cover":null}]},"mermaid":{"enable":false,"version":"9.3.0"}},"version":"2.1.4","navbar":{"auto_hide":true,"color":{"left":"#f78736","right":"#367df7","transparency":35},"links":{"Home":{"path":"/","icon":"fa-regular fa-house"}},"search":{"enable":false,"preload":true}},"page_templates":{"friends_column":2,"tags_style":"blur"},"home":{"sidebar":{"enable":true,"position":"left","first_item":"menu","announcement":null,"links":null},"article_date_format":"auto","categories":{"enable":true,"limit":3},"tags":{"enable":true,"limit":3}}};
    Global.language_ago = {"second":"%s 秒前","minute":"%s 分钟前","hour":"%s 小时前","day":"%s 天前","week":"%s 周前","month":"%s 个月前","year":"%s 年前"};
    Global.data_config = {"masonry":false};
  </script>
    
    <!--- Fontawesome Part-->
    
<link rel="stylesheet" href="/fontawesome/fontawesome.min.css">

    
<link rel="stylesheet" href="/fontawesome/brands.min.css">

    
<link rel="stylesheet" href="/fontawesome/solid.min.css">

    
<link rel="stylesheet" href="/fontawesome/regular.min.css">

    
    
    
    
<meta name="generator" content="Hexo 6.3.0"></head>


<body>
<div class="progress-bar-container">
    
        <span class="scroll-progress-bar"></span>
    

    
        <span class="pjax-progress-bar"></span>
        <span class="pjax-progress-icon">
            <i class="fa-solid fa-circle-notch fa-spin"></i>
        </span>
    
</div>


<main class="page-container">

    

    <div class="main-content-container">

        <div class="main-content-header">
            <header class="navbar-container">
    
    <div class="navbar-content">
        <div class="left">
            
            <a class="logo-title" href="/">
                
                玖忆
                
            </a>
        </div>

        <div class="right">
            <!-- PC -->
            <div class="desktop">
                <ul class="navbar-list">
                    
                        
                            <li class="navbar-item">
                                <!-- Menu -->
                                <a class="" 
                                    href="/"  >
                                    
                                        
                                            <i class="fa-regular fa-house"></i>
                                        
                                        首页
                                    
                                </a>
                                <!-- Submenu -->
                                
                            </li>
                    
                    
                </ul>
            </div>
            <!-- Mobile -->
            <div class="mobile">
                
                <div class="icon-item navbar-bar">
                    <div class="navbar-bar-middle"></div>
                </div>
            </div>
        </div>
    </div>

    <!-- Mobile drawer -->
    <div class="navbar-drawer">
        <ul class="drawer-navbar-list">
            
                
                    <li class="drawer-navbar-item flex-center">
                        <a class="" 
                        href="/"  >
                             
                                
                                    <i class="fa-regular fa-house"></i>
                                
                                首页
                            
                        </a>
                    </li>
                    <!-- Submenu -->
                    
            

        </ul>
    </div>

    <div class="window-mask"></div>

</header>


        </div>

        <div class="main-content-body">

            

            <div class="main-content">

                
                    <div class="fade-in-down-animation">
    <div class="post-page-container">
        <div class="article-content-container">

            
            
                <div class="article-title">
                    <h1 class="article-title-regular">领域驱动设计</h1>
                </div>
            
                
            

            
                <div class="article-header">
                    <div class="avatar">
                        <img src="/images/wenhe.png">
                    </div>
                    <div class="info">
                        <div class="author">
                            <span class="name">meteor</span>
                            
                                <span class="author-label">Lv3</span>
                            
                        </div>
                        <div class="meta-info">
                            <div class="article-meta-info">
    <span class="article-date article-meta-item">
        <i class="fa-regular fa-pen-fancy"></i>&nbsp;
        <span class="desktop">2023-06-05 17:10:51</span>
        <span class="mobile">2023-06-05 17:10</span>
        <span class="hover-info">创建</span>
    </span>
    
        <span class="article-date article-meta-item">
            <i class="fa-regular fa-wrench"></i>&nbsp;
            <span class="desktop">2023-06-05 01:11:20</span>
            <span class="mobile">2023-06-05 01:11</span>
            <span class="hover-info">更新</span>
        </span>
    

    
        <span class="article-categories article-meta-item">
            <i class="fa-regular fa-folders"></i>&nbsp;
            <ul>
                
                    <li>
                        <a href="/categories/%E5%BE%AE%E6%9C%8D%E5%8A%A1/">微服务</a>&nbsp;
                    </li>
                
            </ul>
        </span>
    
    
        <span class="article-tags article-meta-item">
            <i class="fa-regular fa-tags"></i>&nbsp;
            <ul>
                
                    <li>
                        <a href="/tags/%E9%A2%86%E5%9F%9F%E9%A9%B1%E5%8A%A8%E8%AE%BE%E8%AE%A1/">领域驱动设计</a>&nbsp;
                    </li>
                
            </ul>
        </span>
    

    
    
    
    
        <span class="article-pv article-meta-item">
            <i class="fa-regular fa-eye"></i>&nbsp;<span id="busuanzi_value_page_pv"></span>
        </span>
    
</div>

                        </div>
                    </div>
                </div>
            

            <div class="article-content markdown-body">
                <h1 id="领域驱动设计"><a class="markdownIt-Anchor" href="#领域驱动设计">#</a> 领域驱动设计</h1>
<h2 id="大型系统是如何变老的"><a class="markdownIt-Anchor" href="#大型系统是如何变老的">#</a> 大型系统是如何 &quot;变老&quot; 的</h2>
<h3 id="面临的问题"><a class="markdownIt-Anchor" href="#面临的问题">#</a> 面临的问题</h3>
<p>当一个项目使用过长，他的运行效率低、代码乱，需要重构的时候，需要面临一些问题</p>
<ul>
<li>沟通难
<ul>
<li>产品提出一个问题，开发却要很久</li>
</ul>
</li>
<li>开发难
<ul>
<li>代码膨胀，对于大型软件，一个旧的类可能有上千行，无法确定更改后的影响有多大</li>
</ul>
</li>
<li>测试难
<ul>
<li>改了个需求，测试需要组织庞大的测试计划</li>
</ul>
</li>
<li>创新难
<ul>
<li>系统背负的业务越来越重，已经基本丧失了对新技术的灵活敏感</li>
<li>比如从 <code>orm</code>  从 <code>hebernate</code>  换到 <code>mybatis</code> ，因为业务代码是耦合的，无法轻易的更换</li>
</ul>
</li>
</ul>
<h3 id="微服务架构更在防止系统老化吗"><a class="markdownIt-Anchor" href="#微服务架构更在防止系统老化吗">#</a> 微服务架构更在防止系统 &quot; 老化’' 吗</h3>
<p><img  
                     lazyload
                     src="/images/loading.svg"
                     data-src="http://tuchuang.wenhe9.cn/img/202211051602718.png"
                      alt="image-20221105160246592"
                ></p>
<p>虽然在一开始将一个电商项目根据功能分成了若干个微服务，但是随着系统体量的不断增大，某一个或某几个微服务的功能可能也会变得无比庞大，导致系统 &quot;老化&quot;。所以微服务对于防止系统老化只是一个治标不治本的方式。</p>
<h3 id="ddd被认为是目前最理想的方式"><a class="markdownIt-Anchor" href="#ddd被认为是目前最理想的方式">#</a> DDD 被认为是目前最理想的方式</h3>
<p><img  
                     lazyload
                     src="/images/loading.svg"
                     data-src="http://tuchuang.wenhe9.cn/img/202211051614128.png"
                      alt="image-20221105161428086"
                ></p>
<p>在业务上分成一个个的 <code>domain</code>  领域，每个领域只针对自己业务上的属性，系统上不在以 <code>mvc</code>  构建，而是以带有自己功能的领域来构成。这样在微服务进行拆分时，最理想的方式是可以随意按照领域拆分，这样子的话，项目就可以自由组合，结合微服务的体系，更好的体现微服务的能力，使得系统茁壮的成长。</p>
<h3 id="ddd的保证措施"><a class="markdownIt-Anchor" href="#ddd的保证措施">#</a> DDD 的保证措施</h3>
<p><code>DDD</code>  使得一些工作经验不多的人可以对相关功能进行负责，但是需要一些保证措施。</p>
<p><code>mvc</code>  架构的隐患</p>
<ul>
<li>数据库
<ul>
<li>用户的模块发生变化，比如新增了一个字段等等，那么在代码层面可能都需要做一个修改</li>
</ul>
</li>
<li>其他的微服务调用或者第三方 api
<ul>
<li>调用方式发生改变</li>
<li>其他微服务或第三方 api 业务发生变化，比如校验码发生变化，那么在业务代码对获取到的校验码的判断也需要做出相应的修改</li>
</ul>
</li>
<li>消息队列
<ul>
<li>当中间介更换的时候，调用的方式也需要进行变化</li>
</ul>
</li>
</ul>
<p><img  
                     lazyload
                     src="/images/loading.svg"
                     data-src="http://tuchuang.wenhe9.cn/img/202211051626670.png"
                      alt=""
                ></p>
<p><code>mvc</code>  到 <code>ddd</code>  的改造</p>
<p><img  
                     lazyload
                     src="/images/loading.svg"
                     data-src="http://tuchuang.wenhe9.cn/img/202211052014483.png"
                      alt="image-20221105201437426"
                ></p>
<p><strong>将周边的所有的变化隔离开，留下自己的核心</strong></p>
<ul>
<li>
<p>数据库</p>
<ul>
<li>对于数据库的操作不再是引入操作数据库的 <code>dao</code> ，而是通过一个 <code>Repository</code>  接口，这样子当数据源发生变化时，通过这样的一个接口隔离，这样子 <code>orm</code>  的具体实现不会影响到业务，切换的时候只需要更换 <code>Repostory</code>  的具体的实现类，整体的业务不需要变化</li>
<li>使得业务只需要拿到数据即可，至于数据是从哪里来的，这个不用管</li>
</ul>
</li>
<li>
<p>实体</p>
<ul>
<li>
<p>以往的实体 <code>pojo</code>  只需要有一些属性，一些 <code>setter</code> 、 <code>getter</code> ，在 <code>ddd</code>  中把实体和他的业务方法封装到一起，构成一个充血模型，以前的 <code>pojo</code>  是一个贫血模型</p>
</li>
<li>
<p>以前的 <code>pojo</code>  实体会把所有属性放在一个大的实体类里，然后通过上层的 <code>service</code>  来对这些属性做不同的操作，实现不同的业务，这样会造成<strong>贫血失忆症</strong>的后果，即从这个实体上看不出他是要做什么事情的</p>
</li>
<li>
<p>所以在充血模型，把业务方法上进来的好处就是，这个实体要做什么事情就会一目了然的</p>
</li>
</ul>
</li>
<li>
<p>值对象</p>
<ul>
<li>访问值对象必须通过实体来访问</li>
<li>但也不是所有场景都必须通过实体类获取值对象，根据是否是业务来判断</li>
</ul>
</li>
<li>
<p>业务</p>
<ul>
<li><code>DDD</code>  业务指造成实体状态变化的过程，即使得实体的属性发生变化的方法</li>
</ul>
</li>
<li>
<p>防腐层</p>
<ul>
<li>隔离外部服务
<ul>
<li>封装一个 <code>SafeService</code>  接口，将其他微服务或第三方 api 的调用放到这个接口里，在这个接口里进行调用和返回结果的判断</li>
</ul>
</li>
<li>隔离第三方组件
<ul>
<li>封装 <code>MessageProducer</code>  和 <code>MessageConsumer</code>  接口，在这个接口里指定对应的组件，并实现对应使用该组件的方法</li>
</ul>
</li>
</ul>
</li>
<li>
<p>领域服务 隔离实体</p>
<ul>
<li>将修改实体状态而业务代码，也封装成一个接口，在接口的方法中调用实体的业务方法，这样子的好处是，以后再新增一些新的业务的时候，也不会说使得业务层类的代码过于庞大，并且因为使用接口组合的方式，业务的可扩展性也更好，耦合度更低</li>
</ul>
</li>
</ul>
<p>重新编排后的好处</p>
<ul>
<li>业务逻辑清晰，数据流转与业务逻辑完全分离</li>
<li>各个模块的功能都是相对独立的，没有外部依赖，可以单独测试</li>
<li>原有的 <code>service</code>  不再包含任何具体业务的逻辑，仅仅作为组件编排</li>
</ul>
<h3 id="ddd四层架构"><a class="markdownIt-Anchor" href="#ddd四层架构">#</a> DDD 四层架构</h3>
<p><img  
                     lazyload
                     src="/images/loading.svg"
                     data-src="http://tuchuang.wenhe9.cn/img/202211052021437.png"
                      alt="image-20221105202154385"
                ></p>

            </div>

            
                <div class="post-copyright-info">
                    <div class="article-copyright-info-container">
    <ul>
        <li><strong>标题:</strong> 领域驱动设计</li>
        <li><strong>作者:</strong> meteor</li>
        <li><strong>创建于:</strong> 2023-06-05 17:10:51</li>
        
            <li>
                <strong>更新于:</strong> 2023-06-05 01:11:20
            </li>
        
        <li>
            <strong>链接:</strong> https://gitee.com/du-jinliang/2023/06/06/领域驱动设计/
        </li>
        <li>
            <strong>版权声明:</strong> 本文章采用 <a class="license" target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh">CC BY-NC-SA 4.0</a> 进行许可。
        </li>
    </ul>
</div>

                </div>
            

            
                <ul class="post-tags-box">
                    
                        <li class="tag-item">
                            <a href="/tags/%E9%A2%86%E5%9F%9F%E9%A9%B1%E5%8A%A8%E8%AE%BE%E8%AE%A1/">#领域驱动设计</a>&nbsp;
                        </li>
                    
                </ul>
            

            

            
                <div class="article-nav">
                    
                        <div class="article-prev">
                            <a class="prev"
                            rel="prev"
                            href="/2023/06/06/%E6%8E%92%E5%BA%8F%E7%AE%97%E6%B3%95/"
                            >
                                <span class="left arrow-icon flex-center">
                                    <i class="fa-solid fa-chevron-left"></i>
                                </span>
                                <span class="title flex-center">
                                    <span class="post-nav-title-item">排序算法</span>
                                    <span class="post-nav-item">上一篇</span>
                                </span>
                            </a>
                        </div>
                    
                    
                        <div class="article-next">
                            <a class="next"
                            rel="next"
                            href="/2023/06/06/%E6%8E%A5%E5%8F%A3%E5%B9%82%E7%AD%89%E6%80%A7/"
                            >
                                <span class="title flex-center">
                                    <span class="post-nav-title-item">接口幂等性</span>
                                    <span class="post-nav-item">下一篇</span>
                                </span>
                                <span class="right arrow-icon flex-center">
                                    <i class="fa-solid fa-chevron-right"></i>
                                </span>
                            </a>
                        </div>
                    
                </div>
            


            
                <div class="comment-container">
                    <div class="comments-container">
    <div id="comment-anchor"></div>
    <div class="comment-area-title">
        <i class="fa-solid fa-comments"></i>&nbsp;评论
    </div>
    

        
            
    <div id="gitalk-container"></div>
    <script data-pjax
            src="//cdn.jsdelivr.net/npm/gitalk/dist/gitalk.min.js"></script>
    <script data-pjax>

        function loadGitalk() {
            let __gitalk__pathname = decodeURI(location.pathname);
            const __gitalk__pathnameLength = __gitalk__pathname.length;
            const __gitalk__pathnameMaxLength = 50;
            if (__gitalk__pathnameLength > __gitalk__pathnameMaxLength) {
                __gitalk__pathname = __gitalk__pathname.substring(0, __gitalk__pathnameMaxLength - 3) + '...';
            }

            try {
                Gitalk && new Gitalk({
                    clientID: '55bad54a77b7e60ad62d',
                    clientSecret: '1031c81500c6be06e338087cb7b713f2d0201b46',
                    repo: 'wait-you.github.io',
                    owner: 'wait-you',
                    admin: ['wait-you'],
                    id: 'comment',
                    language: 'zh-CN'
                }).render('gitalk-container');

            } catch (e) {
                window.Gitalk = null;
            }
        }

        if ('true') {
            const loadGitalkTimeout = setTimeout(() => {
                loadGitalk();
                clearTimeout(loadGitalkTimeout);
            }, 1000);
        } else {
            window.addEventListener('DOMContentLoaded', loadGitalk);
        }
    </script>



        
    
</div>

                </div>
            
        </div>

        
            <div class="toc-content-container">
                <div class="post-toc-wrap">
    <div class="post-toc">
        <div class="toc-title">此页目录</div>
        <div class="page-title">领域驱动设计</div>
        <ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#%E9%A2%86%E5%9F%9F%E9%A9%B1%E5%8A%A8%E8%AE%BE%E8%AE%A1"><span class="nav-text"> 领域驱动设计</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%A4%A7%E5%9E%8B%E7%B3%BB%E7%BB%9F%E6%98%AF%E5%A6%82%E4%BD%95%E5%8F%98%E8%80%81%E7%9A%84"><span class="nav-text"> 大型系统是如何 &quot;变老&quot; 的</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%9D%A2%E4%B8%B4%E7%9A%84%E9%97%AE%E9%A2%98"><span class="nav-text"> 面临的问题</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%BE%AE%E6%9C%8D%E5%8A%A1%E6%9E%B6%E6%9E%84%E6%9B%B4%E5%9C%A8%E9%98%B2%E6%AD%A2%E7%B3%BB%E7%BB%9F%E8%80%81%E5%8C%96%E5%90%97"><span class="nav-text"> 微服务架构更在防止系统 &quot; 老化’&#39; 吗</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#ddd%E8%A2%AB%E8%AE%A4%E4%B8%BA%E6%98%AF%E7%9B%AE%E5%89%8D%E6%9C%80%E7%90%86%E6%83%B3%E7%9A%84%E6%96%B9%E5%BC%8F"><span class="nav-text"> DDD 被认为是目前最理想的方式</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#ddd%E7%9A%84%E4%BF%9D%E8%AF%81%E6%8E%AA%E6%96%BD"><span class="nav-text"> DDD 的保证措施</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#ddd%E5%9B%9B%E5%B1%82%E6%9E%B6%E6%9E%84"><span class="nav-text"> DDD 四层架构</span></a></li></ol></li></ol></li></ol>

    </div>
</div>
            </div>
        
    </div>
</div>


                

            </div>
            
            

        </div>

        <div class="main-content-footer">
            <footer class="footer">
    <div class="info-container">
        <div class="copyright-info">
            &copy;
            
              <span>2022</span>
              -
            
            2023&nbsp;&nbsp;<i class="fa-solid fa-heart fa-beat" style="--fa-animation-duration: 0.5s; color: #f54545"></i>&nbsp;&nbsp;<a href="/">meteor</a>
        </div>
        
            <script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
            <div class="website-count info-item">
                
                    <span id="busuanzi_container_site_uv" class="busuanzi_container_site_uv">
                        访问人数&nbsp;<span id="busuanzi_value_site_uv" class="busuanzi_value_site_uv"></span>
                    </span>
                
                
                    <span id="busuanzi_container_site_pv" class="busuanzi_container_site_pv">
                        总访问量&nbsp;<span id="busuanzi_value_site_pv" class="busuanzi_value_site_pv"></span>
                    </span>
                
            </div>
        
        <div class="theme-info info-item">
            <span class="powered-by-container">由 <?xml version="1.0" encoding="utf-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg version="1.1" id="圖層_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="1rem" height="1rem" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve"><path fill="#0E83CD" d="M256.4,25.8l-200,115.5L56,371.5l199.6,114.7l200-115.5l0.4-230.2L256.4,25.8z M349,354.6l-18.4,10.7l-18.6-11V275H200v79.6l-18.4,10.7l-18.6-11v-197l18.5-10.6l18.5,10.8V237h112v-79.6l18.5-10.6l18.5,10.8V354.6z"/></svg><a target="_blank" href="https://hexo.io">Hexo</a> 驱动</span>
                <br>
            <span class="theme-version-container">主题&nbsp;<a class="theme-version" target="_blank" href="https://github.com/EvanNotFound/hexo-theme-redefine">Redefine v2.1.4</a>
        </div>
        
            <div class="icp-info info-item"><a target="_blank" rel="nofollow" href="
                
                    beian.miit.gov.cn
                
                ">冀ICP备20010108号</a></div>
        
        
        
            <div id="start_div" style="display:none">
                2022/8/17 11:45:14
            </div>
            <div>
                博客已运行 <span class="odometer" id="runtime_days" ></span> 天 <span class="odometer" id="runtime_hours"></span> 小时 <span class="odometer" id="runtime_minutes"></span> 分钟 <span class="odometer" id="runtime_seconds"></span> 秒
            </div>
        
        
        
            <script async data-pjax>
                try {
                    function odometer_init() {
                    const elements = document.querySelectorAll('.odometer');
                    elements.forEach(el => {
                        new Odometer({
                            el,
                            format: '( ddd).dd',
                            duration: 200
                        });
                    });
                    }
                    odometer_init();
                } catch (error) {}
            </script>
        
        
        
    </div>  
</footer>
        </div>
    </div>

    
        <div class="post-tools">
            <div class="post-tools-container">
    <ul class="article-tools-list">
        <!-- TOC aside toggle -->
        
            <li class="right-bottom-tools page-aside-toggle">
                <i class="fa-regular fa-outdent"></i>
            </li>
        

        <!-- go comment -->
        
            <li class="go-comment">
                <i class="fa-regular fa-comments"></i>
            </li>
        
    </ul>
</div>

        </div>
    

    <div class="right-side-tools-container">
        <div class="side-tools-container">
    <ul class="hidden-tools-list">
        <li class="right-bottom-tools tool-font-adjust-plus flex-center">
            <i class="fa-regular fa-magnifying-glass-plus"></i>
        </li>

        <li class="right-bottom-tools tool-font-adjust-minus flex-center">
            <i class="fa-regular fa-magnifying-glass-minus"></i>
        </li>

        <li class="right-bottom-tools tool-expand-width flex-center">
            <i class="fa-regular fa-expand"></i>
        </li>

        <li class="right-bottom-tools tool-dark-light-toggle flex-center">
            <i class="fa-regular fa-moon"></i>
        </li>

        <!-- rss -->
        

        

        <li class="right-bottom-tools tool-scroll-to-bottom flex-center">
            <i class="fa-regular fa-arrow-down"></i>
        </li>
    </ul>

    <ul class="visible-tools-list">
        <li class="right-bottom-tools toggle-tools-list flex-center">
            <i class="fa-regular fa-cog fa-spin"></i>
        </li>
        
            <li class="right-bottom-tools tool-scroll-to-top flex-center">
                <i class="arrow-up fas fa-arrow-up"></i>
                <span class="percent"></span>
            </li>
        
        
    </ul>
</div>

    </div>

    <div class="image-viewer-container">
    <img src="">
</div>


    


</main>




<script src="/js/utils.js"></script>

<script src="/js/main.js"></script>

<script src="/js/layouts/navbarShrink.js"></script>

<script src="/js/tools/scrollTopBottom.js"></script>

<script src="/js/tools/lightDarkSwitch.js"></script>





    
<script src="/js/tools/codeBlock.js"></script>




    
<script src="/js/layouts/lazyload.js"></script>




    
<script src="/js/tools/runtime.js"></script>

    
<script src="/js/layouts/odometer.min.js"></script>

    
<link rel="stylesheet" href="/assets/odometer-theme-minimal.css">




  
<script src="/js/libs/Typed.min.js"></script>

  
<script src="/js/plugins/typed.js"></script>







<div class="post-scripts pjax">
    
        
<script src="/js/tools/tocToggle.js"></script>

<script src="/js/libs/anime.min.js"></script>

<script src="/js/layouts/toc.js"></script>

<script src="/js/plugins/tabs.js"></script>

    
</div>


    
<script src="/js/libs/pjax.min.js"></script>

<script>
    window.addEventListener('DOMContentLoaded', () => {
        window.pjax = new Pjax({
            selectors: [
                'head title',
                '.page-container',
                '.pjax',
            ],
            history: true,
            debug: false,
            cacheBust: false,
            timeout: 0,
            analytics: false,
            currentUrlFullReload: false,
            scrollRestoration: false,
            // scrollTo: true,
        });

        document.addEventListener('pjax:send', () => {
            Global.utils.pjaxProgressBarStart();
        });

        document.addEventListener('pjax:complete', () => {
            Global.utils.pjaxProgressBarEnd();
            window.pjax.executeScripts(document.querySelectorAll('script[data-pjax], .pjax script'));
            Global.refresh();
        });
    });
</script>




</body>
</html>
